home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / net / omniORB-2.5.0-src.tar.gz / omniORB-2.5.0-src.tar / omniORB_2.5.0 / include / omniVms / unlink.hxx next >
Text File  |  1998-02-05  |  683b  |  31 lines

  1. #ifndef unlink_hxx
  2. #define unlink_hxx
  3.  
  4. #if defined(__VMS) && __VMS_VER < 70000000
  5.  
  6. //  provide unlink() functionality for VMS versions prior to 7.0
  7.  
  8. #include <errno.h>
  9. #include <descrip.h>
  10. #include <lib$routines.h>
  11.  
  12. static int unlink(char const* fileName) {
  13.  
  14.      dsc$descriptor_s dx;
  15.      dx.dsc$w_length = strlen(fileName);
  16.      dx.dsc$b_dtype = DSC$K_DTYPE_T;
  17.      dx.dsc$b_class = DSC$K_CLASS_S;
  18.      dx.dsc$a_pointer = (char*)fileName;    // VMS descriptors are not
  19.                         // const correct!
  20.      vaxc$errno = lib$delete_file(&dx);
  21.      int result = (vaxc$errno & 1) ? 0 : -1;
  22.      if (result == -1) {
  23.     errno = EVMSERR;
  24.      }
  25.      return result;
  26.  
  27. }
  28. #endif    // VMS before 7.0
  29.  
  30. #endif
  31.